package org.koyad.portal.misc;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.koyad.portal.constants.FrameworkConstants;
import org.koyad.portal.context.PistonContext;
import org.koyad.portal.context.PistonRequest;

public class FilterPreProcessor {
	
	public void preProcess(ServletRequest req, ServletResponse resp) {
		
		HttpServletRequest httpReq = (HttpServletRequest)req;
		String requestTileId = httpReq.getParameter(FrameworkConstants.PISTON_TILE_ID);
		httpReq = new PistonRequest(httpReq, requestTileId);
		
		PistonContext.initialize(httpReq, (HttpServletResponse) resp);
		
	}

}
